<template>
	<view>
		<uni-card v-for="item, index in Data" class="card_info" :title=item.clocktype :extra='Data.clocktype'>
			<view style="display: flex;">
				<uni-icons type="auth" size="30" @click="finish(index,true)" style="margin-top:3%;"></uni-icons>
				<view class="info" style="margin-left: 6%;">
					<text class="data_info">{{item.clockinfo}}\n</text>
					<uni-dateformat :date="item.clocktime"></uni-dateformat>
				</view>
			</view>
			
		</uni-card>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				baseurl: "http://localhost:8000/",
				Data:[],
			}
		},
		methods: {
			
		},
		onShow(){
			uni.request({
				url:this.baseurl+"clock/selectall/",
				method:"GET",
				success: (res) => {
					if (res.data.code=="0000"){
						this.Data=res.data.data;
						console.log(this.Data);
					}
					else{
						uni.showModal({
							title: '未知失败',
							content: '未知错误，请联系管理员',
							showCancel: false,
							confirmText: '确定'
						});
					}
				}
			});
		}
	}
</script>

<style lang="scss">
	.card{
		display: flex;
		margin-bottom: 2%;
		
		.info{
			margin-left: 5%;
			margin-right: auto;
			.data_info{
				font-size: 18px;
			}
		}
	}
	
	.card_info{
		border-radius: 25px;
		background: #ffffff;
		padding: 20px;
	}
</style>
